Skip to content

windows: integrate Windows into shared CI matrices (R8, depends on #2422) - #2425

Merged
xushiwei merged 48 commits into
xgo-dev:mainfrom
cpunion:codex/windows-r8-on-r7-integration-20260826
Aug 27, 2026
Merged

windows: integrate Windows into shared CI matrices (R8, depends on #2422)#2425
xushiwei merged 48 commits into
xgo-dev:mainfrom
cpunion:codex/windows-r8-on-r7-integration-20260826

Conversation

@cpunion

@cpunion cpunion commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Depends on #2422. Part of the Windows support proposal in #2325.

The R8-only review range is 4973ccf1059fea0e346c4c0cde3d63e7b63b60aa..c059f643a. Until #2422 merges, GitHub's full diff also contains the stacked R7 work.

What this changes

  • Removes the standalone windows.yml workflow and adds windows-2022 to the existing Go, LLGo, GOROOT, standard-library coverage, docs-local, build-cache, and benchmark matrices.
  • Keeps the existing compiler/runtime/FFI/import audits while making the shared jobs the source of truth for Windows coverage.
  • Makes the integration helpers and applicable C/C++/socket/export demos use each host's native API. POSIX-only pthread demos remain explicitly not applicable on Windows rather than exposing fake pthread bindings.
  • Adds native PE section metrics and Windows benchmark execution, using Go 1.26.7 and the R7 LLVM 19/VS2022 toolchain.
  • Covers official CPython 3.12 embedding on Windows and keeps generated Windows programs on the MSVC ABI.
  • Makes the LLDB smoke/integration suite portable to Windows, including target-aware formatter activation and Windows-compatible Go debug types and pointer parameters.
  • Lowers setjmp/longjmp at the call site, where the returns_twice semantics are preserved. Windows selects the native 386/amd64 entry points and the required ARM64 helper.
  • Keeps low-level synchronization on a native C boundary: Once.Do accepts a //llgo:type C bare void (*)(void) callback. The Windows C wrapper only adapts that callback to InitOnceExecuteOnce; no Go closure representation crosses the boundary.

Remote-install coverage is intentionally unchanged, as agreed in #2325. Removing the MSYS2 host-toolchain dependency is R9; clean release artifacts and broader debugger qualification remain later proposal work.

The temporary github.com/cpunion/lib replacements provide the Windows-native C/C++ bindings exercised here. Their upstream contribution is goplus/lib#26, whose macOS, Linux, and Windows checks currently pass. Removing the replacements is a merge/release gate once an upstream-owned revision is available. Windows/386 bindings that require stdcall use a thin C bridge because LLGo does not yet model that calling convention; x64 and ARM64 use the unified Windows ABI directly.

Validation

  • Windows 11 ARM64 VM (8 GiB), running the x64 Go 1.26.7/LLVM 19.1.7/VS2022 toolchain under Windows x64 emulation for windows/amd64 qualification:
    • all 287 root-module packages passed with the Windows external-link configuration;
    • ./test/go passed in 641 seconds;
    • cl passed with 96.6% statement coverage, ssa with 95.1%, internal/crosscompile with 82.2%, and internal/cabi with 86.3%;
    • the LLDB integration suite passed all 224 checks;
    • cold-cache Thumb, AVR, RISC-V, WASI, and ESP runtime/toolchain downloads and builds passed;
    • CPython/NumPy normal and DWARF execution matrices passed against the official python312.dll.
  • The corrected raw once callback passed actual LLGo execution on macOS ARM64 and Windows 11 ARM64; the Windows-native synchronization implementation is also exercised by c, cpp: support Windows MSVC interop goplus/lib#26.
  • The setjmp, demangle, and libc fixture changes pass IR and actual-execution tests on their applicable native hosts. The POSIX pthread_once fixture is explicitly not applicable on Windows.
  • The generic, explicit-target, and Windows 386/amd64/ARM64 setjmp tests pass on both macOS ARM64 and the Windows VM; their targets are explicit so host ABI selection cannot change the expected IR.
  • go test ./ssa and the complete native TestRunAndTestFromTestlibc suite pass locally on macOS; the corresponding Windows demangle execution and fixture selection pass in the VM.
  • The complete GitHub Actions matrix passes at c059f643a, including the three-platform Go, LLGo, build-cache, benchmark, installation, standard-library coverage, and release-artifact jobs. The Windows full-coverage, LLGo-primary, test-shard, and benchmark jobs completed in 44m09s, 16m59s, 28m00s, and 8m05s respectively.
  • Codecov patch coverage is 97.97980% and passes the project gate. Same-runner benchmark comparisons report no file-size or text-size increase on Linux, macOS, or Windows; Windows text size decreases by 16--304 bytes in four workloads.
  • git diff --check passes.

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

LLGo baseline benchmarks

c059f643ad55 | workflow run | long-term charts

Program measurements

Platform Workload File size vs base Text size vs base Build vs base Run vs base
Linux cprintf 19432 B 0 B / +0.0% 387 B 0 B / +0.0% 356.466 ms +9.384 ms / +2.7% (worse) 1.387 ms -4.896 us / -0.4% (better)
Linux cprintf-lto 19264 B 0 B / +0.0% 368 B 0 B / +0.0% 377.558 ms +27.85 ms / +8.0% (worse) 1.469 ms +17.95 us / +1.2% (worse)
Linux fmtprintf 1652216 B 0 B / +0.0% 501874 B 0 B / +0.0% 2.573 s -6.304 ms / -0.2% (better) 3.624 ms -4.808 us / -0.1% (better)
Linux fmtprintf-lto 1524168 B 0 B / +0.0% 460334 B 0 B / +0.0% 8.721 s -223.7 ms / -2.5% (better) 3.487 ms +12.54 us / +0.4% (worse)
Linux println 62264 B 0 B / +0.0% 15286 B 0 B / +0.0% 367.234 ms +20.58 ms / +5.9% (worse) 1.785 ms +69.37 us / +4.0% (worse)
Linux println-lto 54096 B 0 B / +0.0% 12914 B 0 B / +0.0% 544.001 ms +22.65 ms / +4.3% (worse) 1.856 ms +158.2 us / +9.3% (worse)
macOS cprintf 84480 B 0 B / +0.0% 16669 B 0 B / +0.0% 474.938 ms +41.71 ms / +9.6% (worse) 7.077 ms +4.59 ms / +184.5% (worse)
macOS cprintf-lto 100704 B 0 B / +0.0% 16649 B 0 B / +0.0% 491.263 ms +27.58 ms / +5.9% (worse) 2.962 ms +202.1 us / +7.3% (worse)
macOS fmtprintf 1512800 B 0 B / +0.0% 882816 B 0 B / +0.0% 2.893 s +337.4 ms / +13.2% (worse) 6.322 ms +184.4 us / +3.0% (worse)
macOS fmtprintf-lto 1208464 B 0 B / +0.0% 875856 B 0 B / +0.0% 7.571 s +531.1 ms / +7.5% (worse) 6.124 ms -221 us / -3.5% (better)
macOS println 114784 B 0 B / +0.0% 35101 B 0 B / +0.0% 485.968 ms +41.12 ms / +9.2% (worse) 4.837 ms +1.056 ms / +27.9% (worse)
macOS println-lto 118656 B 0 B / +0.0% 32753 B 0 B / +0.0% 640.275 ms -1.225 ms / -0.2% (better) 4.051 ms +278.8 us / +7.4% (worse)
Windows cprintf 120320 B 0 B / +0.0% 65787 B 0 B / +0.0% 549.272 ms -9.289 ms / -1.7% (better) 2.861 ms -39.8 us / -1.4% (better)
Windows cprintf-lto 119808 B 0 B / +0.0% 65707 B -16 B / -0.02434% (better) 580.207 ms +15.42 ms / +2.7% (worse) 2.776 ms -72.1 us / -2.5% (better)
Windows fmtprintf 1608192 B 0 B / +0.0% 687254 B -160 B / -0.02328% (better) 2.914 s +199.5 ms / +7.3% (worse) 7.126 ms -169.8 us / -2.3% (better)
Windows fmtprintf-lto 1650176 B 0 B / +0.0% 685718 B -304 B / -0.04431% (better) 6.938 s -65.76 ms / -0.9% (better) 7.146 ms -186.3 us / -2.5% (better)
Windows println 194560 B 0 B / +0.0% 120534 B 0 B / +0.0% 548.476 ms -9.133 ms / -1.6% (better) 5.745 ms +2 us / +0.03483% (worse)
Windows println-lto 190976 B 0 B / +0.0% 117590 B -16 B / -0.0136% (better) 706.412 ms +6.564 ms / +0.9% (worse) 5.608 ms -97.7 us / -1.7% (better)
Core language and compiler benchmarks
Platform Benchmark ns/op vs base
Linux BenchmarkLookupPCRandom 12.260 ns/op -0.01 ns/op / -0.1% (better)
Linux BenchmarkMergeCompilerFlags 143.900 ns/op -0.7 ns/op / -0.5% (better)
Linux BenchmarkMergeLinkerFlags 94.520 ns/op -0.35 ns/op / -0.4% (better)
Linux BenchmarkChannelBuffered 38.540 ns/op +0.55 ns/op / +1.4% (worse)
Linux BenchmarkChannelHandoff 25267 ns/op -397 ns/op / -1.5% (better)
Linux BenchmarkDefer 48.180 ns/op +0.12 ns/op / +0.2% (worse)
Linux BenchmarkDirectCall 2.110 ns/op +0.001 ns/op / +0.04742% (worse)
Linux BenchmarkGlobalRead 2.112 ns/op +0.001 ns/op / +0.04737% (worse)
Linux BenchmarkGlobalWrite 2.805 ns/op +0.001 ns/op / +0.03566% (worse)
Linux BenchmarkGoroutine 30795 ns/op +449 ns/op / +1.5% (worse)
Linux BenchmarkInterfaceCall 8.442 ns/op 0 ns/op / +0.0%
Linux BenchmarkRuntimeGetG 1.759 ns/op 0 ns/op / +0.0%
macOS BenchmarkLookupPCRandom 15.420 ns/op +2.81 ns/op / +22.3% (worse)
macOS BenchmarkMergeCompilerFlags 152.200 ns/op +12.8 ns/op / +9.2% (worse)
macOS BenchmarkMergeLinkerFlags 101.100 ns/op +14.67 ns/op / +17.0% (worse)
macOS BenchmarkChannelBuffered 30.340 ns/op -3.26 ns/op / -9.7% (better)
macOS BenchmarkChannelHandoff 13069 ns/op +721 ns/op / +5.8% (worse)
macOS BenchmarkDefer 48.550 ns/op +0.51 ns/op / +1.1% (worse)
macOS BenchmarkDirectCall 1.120 ns/op -0.146 ns/op / -11.5% (better)
macOS BenchmarkGlobalRead 1.186 ns/op -1.075 ns/op / -47.5% (better)
macOS BenchmarkGlobalWrite 1.355 ns/op -0.282 ns/op / -17.2% (better)
macOS BenchmarkGoroutine 41991 ns/op -1101 ns/op / -2.6% (better)
macOS BenchmarkInterfaceCall 5.074 ns/op -1.075 ns/op / -17.5% (better)
macOS BenchmarkRuntimeGetG 2.869 ns/op +0.102 ns/op / +3.7% (worse)
Windows BenchmarkLookupPCRandom 9.496 ns/op +0.265 ns/op / +2.9% (worse)
Windows BenchmarkMergeCompilerFlags 412 ns/op +10.5 ns/op / +2.6% (worse)
Windows BenchmarkMergeLinkerFlags 362.900 ns/op +6.2 ns/op / +1.7% (worse)
Windows BenchmarkChannelBuffered 39.910 ns/op +0.23 ns/op / +0.6% (worse)
Windows BenchmarkChannelHandoff 2700 ns/op +368 ns/op / +15.8% (worse)
Windows BenchmarkDefer 38.450 ns/op -2.72 ns/op / -6.6% (better)
Windows BenchmarkDirectCall 0.269 ns/op 0 ns/op / +0.0%
Windows BenchmarkGlobalRead 0.324 ns/op -0.013 ns/op / -3.9% (better)
Windows BenchmarkGlobalWrite 6.920 ns/op -0.008 ns/op / -0.1% (better)
Windows BenchmarkGoroutine 69187 ns/op -2732 ns/op / -3.8% (better)
Windows BenchmarkInterfaceCall 4.511 ns/op +0.079 ns/op / +1.8% (worse)
Windows BenchmarkRuntimeGetG 0.891 ns/op -0.0134 ns/op / -1.5% (better)

Compared with ff9bad850389 measured in the same runner job.

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.97980% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/crosscompile/compile/compile.go 88.23% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@cpunion
cpunion marked this pull request as ready for review August 27, 2026 01:43
@cpunion

cpunion commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

@fennoai please review the completed R8 shared-CI integration. All Linux, macOS, and Windows jobs and the Codecov patch gate are passing.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Windows R8-on-R7 integration

Reviewed the R8-only range (09a23ef..f293677, 84 files) — the actual scope of this PR per the description; the full base-diff also carries the stacked #2422 work, which is out of scope here.

This is a large, well-executed portability change: CI matrix consolidation (removing windows.yml), platform-split demos, portable LLDB tooling, and Windows PE metrics. Test coverage is strong — nearly every production change is paired with a test (TestAddPESections, TestWindowsTarXzTools, TestWindowsDebugPointerParameter, TestRunQuietIncludesCommandOutput, etc.). Comments explain the Windows-specific rationale well. No high-severity or blocking issues found; the notes below are refinements.

Cross-cutting notes (no reliable single inline location):

  • Supply-chain — github.com/cpunion/lib replacement. The root go.mod:30 and all demo/tool go.mod files replace github.com/goplus/lib with a personal fork pinned to v0.0.0-20260822071805-ebe22363a225. The PR body already flags this as temporary, which is right — the important one is the root go.mod (the compiler build itself), not just the demos. go.sum hashes guard against tampered fetches, but this should revert to an upstream-owned tag before release. Tracking this is worthwhile.
  • internal/crosscompile/fetch.go.tar.xz extraction trust path. The Go-native extractTarGz/extractZip paths enforce a path-traversal (illegal file path) guard; the .tar.xz path shells out to external tar/bsdtar/MSYS2 tar with --force-local and relies on the tool's own protections. Combined with downloads still having no checksum/signature verification (downloadFile), a moved/altered release archive could write outside dest. This is largely pre-existing (the PR only changed tool selection), but pinning checksums for the ESP/WASI archives would close the gap.
  • _demo/c/syncdebug/once_default.go vs once_windows.go. The two files implement the same llsync.Once test with gratuitously different structure (package-level vars + named funcs vs. locals + closures). If the closure form works on Windows it almost certainly works everywhere; a shared implementation (or a comment explaining why they must differ) would reduce drift risk.

Verified and dismissed: an internal reviewer flagged test_windows_runtime.ps1 referencing a missing check_windows_imports.ps1, but that file exists at .github/workflows/check_windows_imports.ps1 — not an issue.

Comment thread cmd/internal/lldb/llgo_plugin.py Outdated
Comment thread benchmark/baseline/main.go
@fennoai

fennoai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

FennoAI is processing your request, please wait a moment...

@cpunion

cpunion commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Review follow-up:

  • Addressed both inline findings in c71c807 and resolved their threads.
  • Unified the duplicated syncdebug Once fixture across hosts in 2910a58; Windows still exercises the closure form.
  • The cpunion/lib replacement remains an explicitly staged dependency and must be removed through an upstream-owned revision before R12 release qualification.
  • Archive checksum/traversal hardening is pre-existing download infrastructure, not part of the shared-matrix change; it should remain a separate scoped follow-up rather than expanding R8.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: R8 shared-CI Windows integration

Reviewed the locked R8-only range e1791699...f2936775 (357 files, ~13.7k/-2.2k). Focus was the production runtime/codegen surface — Windows fault handling, SEH unwind, semaphores, threading, RNG, print, setjmp, and the CI matrix reshaping. Four review passes ran (quality, performance, security, docs).

Overall: high-quality, carefully engineered work. The _default/_windows/_windows_<arch> build-tag partitioning is, in nearly every family I checked (setjmp, fault, cpuprof, sema, foreign-thread, ffi-abi, gc-threads, llvm-config), provably complete and non-overlapping, and the native C/asm bridges (rand, fault handler, print, syscall, setjmp, thread/FLS) are bounds-checked with no memory-safety, injection, or weak-randomness issues found. CI trust boundaries are sound: pull_request (not pull_request_target), contents: read, secrets confined to appropriate steps, toolchain pins consistent (Go 1.26.7 / LLVM 19 / VS2022).

A few items worth a look, left as inline comments. None are blocking.

Notes (not inline):

  • Supply-chain (Medium): replace github.com/goplus/lib => github.com/cpunion/lib is added to the root and every sub-module go.mod (_xtool, doc/_readme, _demo/{c,go,py,embed}). Content is pinned + go.sum-verified, and the PR body flags it as temporary — recommend gating release on moving these commits to an org-owned/tagged upstream so a released version never depends on a personal fork. (Inline note on root go.mod.)
  • CI hardening (Low, pre-existing): .github/workflows/benchmark.yml interpolates ${{ github.event.pull_request.base.ref }} directly into a run: block. The line itself is pre-existing (this PR only adds shell: bash to that step), exploitability is low (base ref is an existing branch name, pull_request trigger, contents: read, no secrets), but normalizing to the env:-indirection pattern already used elsewhere in the same file would be good hygiene.

Verification of the described validation matrix (287 packages, ./test/go, coverage %, LLDB suite, cross-target runtime builds) relies on the CI results reported as green; I reviewed the code and configuration, not the live job logs.

Additional findings

  • runtime/internal/lib/runtime/runtime_windows.go:1: [P2] Windows build-tag overlaps baremetal/wasm (duplicate LLGoFiles): runtime_windows.go is tagged //go:build windows, while sibling runtime_baremetal.go is //go:build baremetal || wasm. A windows && (baremetal || wasm) build satisfies both, and both declare LLGoPackage/LLGoFiles constants — that configuration would fail with duplicate declarations. runtime_default.go in the same package correctly excludes windows (!baremetal && !wasm && !windows), so this is the one file in the family whose tag isn't provably disjoint. If windows && baremetal/windows && wasm is not a real target the impact is latent, but tightening to //go:build windows && !baremetal && !wasm removes the ambiguity at zero cost.

Comment thread go.mod Outdated
Comment thread runtime/internal/lib/runtime/sema_windows_llgo.go
@cpunion

cpunion commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

CI follow-up: the attempted syncdebug deduplication in 2910a58 was not valid. POSIX pthread_once accepts a bare C function pointer, while an LLGo capturing closure is represented as {function, environment}; the Windows wrapper deliberately supplies the closure bridge. This caused the same LLVM verifier failure in the macOS primary job and both Go development jobs.

Reverted that change in b7fce75, documented the required platform distinction in 4b8549e, and locally verified the Unix fixture through LLGo. The two inline review fixes remain intact.

@cpunion

cpunion commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Once ABI follow-up:

  • Once.Do now accepts the same bare void (*)(void) callback as POSIX pthread_once; Windows adapts only the native INIT_ONCE callback signature and no longer sees LLGo's closure representation.
  • Capturing closures use the explicit Once.DoFunc upper-layer adapter. Go retains the closure, while C receives a fixed callback and opaque context pointer. Concurrent distinct contexts and nested calls are covered.
  • The corresponding dependency is now available for review as c, cpp: support Windows MSVC interop goplus/lib#26; its CI is passing.
  • Actual LLGo execution passed on macOS ARM64 and Windows 11 ARM64, and the once IR fixture plus runtime synchronization package tests pass locally.

@cpunion
cpunion force-pushed the codex/windows-r8-on-r7-integration-20260826 branch from 63831cd to 798ad5c Compare August 27, 2026 12:17
@cpunion
cpunion marked this pull request as draft August 27, 2026 12:57
@cpunion
cpunion marked this pull request as ready for review August 27, 2026 19:39
@cpunion

cpunion commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

@fennoai please review the current completed R8 diff at 29a713b47. The full Linux/macOS/Windows CI matrix, three-platform benchmarks, and Codecov patch gate (97.97980%) are all passing; all prior review threads are resolved.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FennoAI Review — Windows R8-on-R7 integration

Large, well-structured PR. Build-tag splits (*_windows.go / *_default.go / *_unix.go), the crosscompile Windows toolchain selection, the MSVC import-library resolver, and the sync/once simplification are clean and well-covered by new tests. No blocking correctness regressions found. A few items worth confirming before merge, plus inline notes.

Items without a single reliable inline location:

  • Fork dependency in mainline modules. Every go.mod (root, _demo/*, _xtool, doc/_readme) adds replace github.com/goplus/lib => github.com/cpunion/lib v0.0.0-20260827173821-.... This redirects the whole C/OS binding surface (sockets, os, net) to a personal fork. go.sum pins it so it isn't silently mutable, but please confirm this is a temporary bootstrap to be reverted to a tagged upstream goplus/lib release before merge. Some go.sum files also retain an older unused pseudo-version (...20260822071805-...) that go mod tidy would drop.
  • .github/workflows/benchmark.yml (~L47–51): git fetch https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git ${{ github.event.pull_request.base.ref }} interpolates PR metadata directly into a run: block. These are maintainer-controlled target-branch values (low risk) and the PR only added shell: bash here, but passing them via env: and quoting "$VAR" is the safer pattern.
  • Downloaded toolchain archives lack checksum/signature verification (internal/crosscompile/fetch.go downloadFile). The PR adds a new Windows source (github.com/espressif/llvm-project/releases/...) whose archive is extracted then executed as the compiler. Pin-by-tag helps but recording/verifying a SHA-256 would close the gap — especially combined with the extractZip note below.

Findings without inline locations

  • internal/crosscompile/fetch.go:362: extractZip writes to filepath.Join(dest, file.Name) with no containment check, so a crafted entry like ../../evil can escape dest (zip-slip). The sibling extractTarGz already guards this (illegal file path check). Current sources are trusted/HTTPS so exploitability is limited, but since this file is being touched for Windows it's worth adding the same prefix check (plus a symlink guard) here.
  • README.md:356: The install guide still reads ### on Windows / TODO, but this PR makes Windows a CI-tested target — doc.yml even runs the README code blocks on windows-2022, so the docs are exercised on Windows while telling users installation is unimplemented. Please fill this in (mirroring the CI setup-deps steps) or mark it experimental. The support matrix around L50–56 also omits the new Windows amd64 native CI coverage.

Comment thread _demo/c/netdbdemo/netdb.go
Comment thread ssa/cl_test.go
Comment thread internal/crosscompile/compile/compile.go
@fennoai

fennoai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

FennoAI is processing your request, please wait a moment...

@cpunion

cpunion commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

FennoAI follow-up:

  • Fixed the actionable DNS finding in fde4aef34: netdbdemo now resolves localhost, and LLGo execution passes locally.
  • Removed every stale older fork checksum in c059f643a; go mod tidy -diff is now clean in the root and all affected submodules.
  • The current cpunion/lib replacement remains an explicit bootstrap only. goplus/lib#26 and a resulting upstream-owned version are the dependency gate before this stack can land.
  • cltest.FromDir already disabled output checking, and each archive response file lives in one invocation-owned temp directory; those two inline notes do not require code changes.
  • The README intentionally does not declare Windows generally supported yet: R8 integrates and exercises it, while R9-R12 still complete the proposal. The pre-existing benchmark interpolation and archive hardening concerns should stay separately scoped rather than enlarging R8.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review: R8 diff at 29a713b47 (post-#2422)

Re-reviewed the locked range ff9bad85...29a713b4 (128 files, +2550/-775). Now that dependency #2422 has merged, this is a genuinely R8-only diff — much smaller and cleaner than the earlier stacked view. Ran all four passes (quality, performance, security, docs).

Prior findings — status:

  • Build-tag overlap (runtime_windows.go) and semaRelease wake-per-release — both now land at the merged base via #2422 and are outside this PR's diff range. Not re-flagged here; they belong to #2422's history.
  • goplus/libcpunion/lib replacestill present and re-introduced by this PR (see below).

New results this pass:

  • Quality: No in-range findings. Spot-verified correct: the _default/_unix/_windows sync splits, macho_size.go close-before-rename handling on Windows, clang.go CommandLineToArgvW backslash quoting, and ssa/eh.go arch-dispatched setjmp/longjmp.
  • Performance: No regressions. The crosscompile archiving change (long argv → objects.rsp response file for llvm-ar) is a scalability improvement for the many-object newlib case; the Windows GNU tar/xz path is a large win; resolveMSVCImportLibraries is bounded one-time link-step cost gated behind a fast-path check that leaves non-MSVC builds untouched.
  • Security: CI trust boundaries are sound — pull_request (not pull_request_target), persist-credentials: false on untrusted checkouts, dispatch/token jobs gated to non-PR events on xgo-dev/llgo with ref/SHA validation, and the native C shims (profile_windows.c, sync_windows.c) are bounds-checked with overflow-aware deadline math. One finding, inline below.
  • Docs: No findings. Renamed llvm_config_windows.go comment matches the new name/behavior; toolchain pins (Go 1.26.7 / LLVM 19 / VS2022) are internally consistent.

I reviewed code and configuration, not the live CI logs — the reported green matrix and 97.98% patch coverage are taken as stated.

Comment thread go.mod

replace github.com/xgo-dev/llgo/runtime => ./runtime

replace github.com/goplus/lib => github.com/cpunion/lib v0.0.0-20260827173821-b993779acb60

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Reintroduces goplus/lib -> cpunion/lib personal-fork replace

This range adds replace github.com/goplus/lib => github.com/cpunion/lib v0.0.0-20260827173821-b993779acb60. The merged base (post-#2422) tracks upstream github.com/goplus/lib v0.3.1 with no replace, so this PR moves the dependency — which is compiled into essentially every LLGo-built binary — back to a personal fork, and propagates the same replace across _xtool/go.mod, doc/_readme/go.mod, and _demo/{c,go,py,embed}/go.mod. The pseudo-version is content-pinned via go.sum (tampering-after-the-fact is guarded), but a personal-account fork is a weaker trust/longevity anchor for a shared project. Since the base already uses the org-owned upstream, recommend dropping this replace before merge, or gating release on repointing to an xgo-dev/org-owned tagged source and diffing the fork against upstream. Prior review flagged this as temporary; it is still present with a bumped version.

@cpunion

cpunion commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Post-review validation at c059f643a is complete: all 51 checks pass. Codecov patch coverage is 97.97980%; Linux/macOS/Windows same-runner benchmarks show no file-size increase, and no text-size increase outside the existing 16--304-byte Windows reductions. Windows full Go coverage, LLGo primary, LLGo test shard, and benchmark completed in 44m09s, 16m59s, 28m00s, and 8m05s. The PR body now records the final head and results.

@xushiwei
xushiwei merged commit e33e346 into xgo-dev:main Aug 27, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants